<?php

namespace SpecialOperations\GameBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * SpecialOperations\GameBundle\Entity\Metalworks
 */
class Metalworks extends Building
{
    public function getMetalProduction($from, $to=null){
         if(!$to){
            $to=time();
        }
        $time=$to-$from;
                return $this->getMetalProductionRatio()*$time/District::TIME;
        
    }
    
    public function getMetalProductionRatio(){
        //*(1+$this->getDistrict()->getOwner()->getResearch()->getMetalprod()*0.1) -> dodać jak będą zaimplementowane już jakieś badania

        return (30*($this->getLevel()+1)*$this->getWorstMultiplier()*pow(1.1, $this->getLevel()*$this->getWorstMultiplier()));
    }
    
    public function __ToString(){
        return 'Huta metalu';
    }
}